package ooday01.homework;

public class CarTest {
    public static void main(String[] args) {
     //第一遍
      /*
        //无参：
        Car car1 =new Car();
        car1.brand ="小米su7Max";
        car1.color ="霞光紫";
        car1.price = 299000;
        car1.start();
        car1.run();
        car1.stop();


        //有参：
        Car ca2 = new Car("小米su7Max","海湾蓝",299000);
        ca2.start();
        ca2.run();
        ca2.stop();

       */

     //第二遍：
        //无参访问
     Car car1 = new Car();
     car1.brand = "奔驰";
     car1.color = "黑色";
     car1.price = 30;
     car1.start();
     car1.run();
     car1.stop();

        System.out.println("------------------------------");
     //有参访问：
        Car car2 = new Car("奔驰","灰色",30);
        car2.start();
        car2.run();
        car2.stop();




    }

}
